/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.benimetum.database;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
 *
 * @author sony
 */
public class Analyzer implements Runnable{
    
    private static Connection watcher;
    @Override
    public synchronized void run() {
        try {
            Class.forName("com.mysql.jdbc.Driver");
                        watcher = DriverManager.getConnection ("jdbc:mysql://localhost/benimetum",
                                                                     "benimetum",
                                                                     "benimetum");
            while (true) {            
                try {
  
                        java.sql.Statement stmt = watcher.createStatement();
                        java.sql.ResultSet rs = stmt.executeQuery("ANALYZE TABLE Nodes,Triples,Quads,Prefixes;");
                        System.out.println("Yaptım");
                    wait(0x2bf20);
                } catch (InterruptedException ex) {
                    Logger.getLogger(Analyzer.class.getName()).log(Level.SEVERE, null, ex);
                }
            }
        } catch (SQLException ex) {
            Logger.getLogger(Analyzer.class.getName()).log(Level.SEVERE, null, ex);
        } catch (ClassNotFoundException ex) {
            Logger.getLogger(Analyzer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
